CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11 FATAL_ERROR)

set(CMAKE_MACOSX_RPATH 1)

SET(CMAKE_AUTOMOC ON)
SET(CMAKE_AUTOUIC ON)
SET(CMAKE_AUTORCC ON)
SET(CMAKE_INCLUDE_CURRENT_DIR ON)

FIND_PACKAGE(Qt5Core REQUIRED)
FIND_PACKAGE(Qt5Gui REQUIRED)
FIND_PACKAGE(Qt5Widgets REQUIRED)

INCLUDE_DIRECTORIES("${PROJECT_SOURCE_DIR}/src")

SET(HEADER_FILES QtGuider.h)

SET(SOURCE_FILES main.cpp
                 QtGuider.cpp
                 QtGuider.qrc
                 QtGuider.ui)

ADD_EXECUTABLE(QtGuider WIN32 ${HEADER_FILES} ${SOURCE_FILES})

TARGET_LINK_LIBRARIES(QtGuider Qt5::Core Qt5::Gui Qt5::Widgets Qt5Flex)

SET_TARGET_PROPERTIES(QtGuider PROPERTIES DEBUG_POSTFIX d)

INSTALL(TARGETS QtGuider
        RUNTIME DESTINATION bin
        LIBRARY DESTINATION lib
        ARCHIVE DESTINATION lib)
